Inside Macintosh: Imaging with QuickDraw

Previous | Chapter Top | Chapter Contents | Next

Using Color QuickDraw

To use Color QuickDraw, you generally

This section gives an overview of routines that your application typically calls while using Color QuickDraw. Before calling these routines, however, your application should test for the existence of Color QuickDraw by using the Gestalt function with the gestaltQuickDrawVersion selector. The Gestalt function returns a 4-byte value in its response parameter; the low-order word contains QuickDraw version data. In that low-order word, the high-order byte gives the major revision number and the low-order byte gives the minor revision number. If the value returned in the response parameter is equal to the value of the constant gestalt32BitQD13 , then the system supports the System 7 version of Color QuickDraw. Listed here are the various constants, and the values they represent, that indicate earlier versions of Color QuickDraw.

CONST
    gestalt8BitQD           = $100;     {8-bit Color QD}
    gestalt32BitQD          = $200;     {32-bit Color QD}
    gestalt32BitQD11        = $210;     {32-bit Color QDv1.1}
    gestalt32BitQD12        = $220;     {32-bit Color QDv1.2}
    gestalt32BitQD13        = $230;     {System 7: 32-bit Color QDv1.3}

Your application can also use the Gestalt function with the selector gestaltQuickDrawFeatures to determine whether the user's system supports various Color QuickDraw features. If the bits indicated by the following constants are set in the response parameter, then the features are available:

CONST
    gestaltHasColor                 = 0;    {Color QuickDraw is present}
    gestaltHasDeepGWorlds           = 1;    {GWorlds deeper than 1 bit}
    gestaltHasDirectPixMaps         = 2;    {PixMaps can be direct--16 or }
                                            { 32 bit}
    gestaltHasGrayishTextOr         = 3;    {supports text mode }
                                            { grayishTextOr}

When testing for the existence of Color QuickDraw, your application should test the response to the gestaltQuickDrawVersion selector (rather than test for the result  gestaltHasColor , which is unreliable, from the  gestaltQuickDrawFeatures selector). The support for offscreen graphics worlds indicated by the gestaltHasDeepGWorlds response to the  gestaltQuickDrawVersion selector is described in the chapter "Offscreen Graphics Worlds." The support for the text mode indicated by the gestaltHasGrayishTextOr response is described in the chapter "QuickDraw Text" in Inside Macintosh: Text . For more information about the Gestalt function, see the chapter "Gestalt Manager" in Inside Macintosh: Operating System Utilities .

Initializing Color QuickDraw

Creating Color Graphics Ports

Drawing With Different Foreground Colors

Drawing With Pixel Patterns

Copying Pixels Between Color Graphics Ports

Highlighting


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next